<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/react.js"></script>
    <script src="lib/react-dom.js"></script>
    <script src="lib/browser.js"></script>
</head>
<body>
    

    <div  id="root"></div>

    <script  type="text/babel">


        class Clock extends  React.Component{
            constructor(props){
                super(props)
                this.state = {
                    number : 0
                }

            }


            componentDidMount(){

                this.setState({
                    number : Number(this.props.start)
                })

                setInterval( ()=>{
                    // this.state.number += 1
                    this.setState({
                        number : this.state.number + 1
                    })
                },1000 )
            }

            render(){
                return (<div>
                        <h1>{ this.state.number }</h1>
                    
                    </div>)
            }

        }
        


        
        //jsx     javascript + xml  
        ReactDOM.render(<Clock  start="18"/>,document.getElementById("root"))

    </script>
</body>
</html>